﻿Imports System.IO
Imports System.Environment
Public Class Dev_Debug
    Dim SB As New ScavengerBrowser
    Dim Proc_usage As New System.Diagnostics.PerformanceCounter("Processor", "% Processor Time", "_total")
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim fFile As New FileInfo(Environment.GetFolderPath(SpecialFolder.ApplicationData) + "\Phenix\Scavenger\User Data\history.svg")
        If fFile.Exists Then
            Process.Start(fFile.ToString)
        Else
            MsgBox("History.svg is missing from the directory. Please restart Scavenger.", MsgBoxStyle.Critical, "Error")
        End If
    End Sub

    Private Sub Dev_Debug_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim refresh As New Timer
        AddHandler refresh.Tick, AddressOf On_Tick
        refresh.Interval = 500
        refresh.Start()
    End Sub
    Public Sub On_Tick()
        LURL.Text = "Last URL: " + SB.URL_Return
        CURL.Text = "CurURL: " + Scavenger.URL.Text
        TC.Text = "Tab Count: " + Scavenger.TabControl1.TabCount.ToString
        PROC.Text = "CPU: " + (CInt(Proc_usage.NextValue()) & "%").ToString
        RAM.Text = "RAM: " + (GC.GetTotalMemory(True) / "10,000").ToString + " MB"
    End Sub
End Class